*** Settings ***
Documentation  用户登录
Library    SeleniumLibrary

*** test cases ***
#用户登录成功并发布一个话题
#    Open Browser    http://39.107.96.138:3000/  Chrome
#    Click Element   xpath://*[@href="/signin"]
#    Input Text  //*[@id="name"]     microyl
#    Input Text  //*[@id="pass"]     396639
#    Click Element   xpath://*[@type="submit"]
#    Maximize Browser Window
#    Click Element   //*[@class="span-success"]
#    Click Element   //*[@id="tab-value"]
#    Click Element   //*[@value="share"]
#    Input Text    //*[@id="title"]     今天中午吃了回锅肉
#    Click Element   xpath://*[@class="CodeMirror-scroll"]
#    Press Keys      xpath://*[@class="CodeMirror-scroll"]   大家好，这是一个临时文件
#    Click Element   xpath://*[@type="submit"]

#    Press Keys      xpath://*[@class="CodeMirror-scroll"]   CTRL+a
#    Press Keys      xpath://*[@class="CodeMirror-scroll"]   CTRL+b

#用户登录并成功修改一个话题
#    Open Browser    http://39.107.96.138:3000/topic/5df098cc1c711a06a183f4a9  Chrome
#    Maximize Browser Window
#    Click Element   xpath://*[@href="/signin"]
#    Input Text  //*[@id="name"]     microyl
#    Input Text  //*[@id="pass"]     396639
#    Click Element   xpath://*[@type="submit"]
#    Click Element   css:.fa.fa-lg.fa-pencil-square-o
#    #如果class中间有空格，说明有多个，中间要用点连接  前面的css:一定要有
#    Press Keys      xpath://*[@class="CodeMirror-scroll"]   ，这个文件已经被我修改了
#    Click Element   xpath://*[@type="submit"]

用户登录成功并成功删除一个话题
    Open Browser    http://39.107.96.138:3000/  Chrome
    Maximize Browser Window
    Click Element   xpath://*[@href="/signin"]
    Input Text  //*[@id="name"]     microyl
    Input Text  //*[@id="pass"]     396639
    Click Element   xpath://*[@type="submit"]
    Click Element   xpath://*[@class="user_name"]
    Click Element   xpath://*[@id="content"]//div[@class="panel"][2]//div[@class="cell"][1]//div[@class="topic_title_wrapper"][1]//a[@class="topic_title"]
    ${currentUrl}   Log Location
    Click Element   css:.fa.fa-lg.fa-trash
    Handle Alert
    Go To       ${currentUrl}
    Element Text Should Be  //strong    此话题不存在或已被删除。
    Close Window
#删除的因为是alert窗口，所以无法截图